<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Geral - Categorias Pessoas</title>

<link rel="stylesheet" type="text/css" href="../../includes/css/azul.css">

<script language="javascript" type="text/javascript" src="../../includes/classes/class.Geral.js"></script>
<script language="javascript" type="text/javascript">
var geral = new Geral;

function inserir(){
	var id_cat = document.form.categoria_sel.value;
	var id_cad = document.form.id_cad.value;
	window.location ="categorias_ass_man.php?evento=inserir&id_cat="+id_cat+"&id_cad="+id_cad;	
}



function excluir(){
	
	var id = 0;
	var i  = 0;

	for (i=0;i<document.form2.elements.length;i++){
	  if(document.form2.elements[i].type == "checkbox"){
		  if(document.form2.elements[i].checked){
			 //alert(document.form2.elements[i].value);
			 id = id + ";"+document.form2.elements[i].value;
		  }
	  }
	}
	
	if(confirm("Tem certeza que deseja excluir o(s) registro(s)?")){
		window.location ="categorias_ass_man.php?evento=excluir&id="+id;	
	}
	
}


function fechaTelas(){
	window.close();	
}




</script>

</head>

<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

<fieldset>
<legend>
<font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
<b>Categorias Pessoas F/J</b>
</font>
</legend>

<form action="#" method="post" name="form">
<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
    <td align="center" valign="middle" height="8">
    </td>
    </tr>

    <tr>
    <td>
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    <strong>&nbsp;&nbsp;Categoria:</strong> 
    </font>
    &nbsp;
    <select name="categoria_sel" id="categoria_sel" class="campo_texto" onChange="linkTelaCob(this.value)">
        <option value="">Selecione a categoria</option>
        <!-- START BLOCK : CATS -->	
        <option value="{id_cat}">{ncat}</option>
        <!-- END BLOCK : CATS -->
    </select>
    <input type="hidden" name="id_cad" value="{id_cad}" />
    <input type="button" value="Inserir" onClick="inserir();">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="button" value="Fechar" onClick="fechaTelas();">
    </td>
    </tr>
    
    <tr>
    <td align="center" valign="middle" height="8">
    </td>
    </tr>
</table>
</form>
</fieldset>

<br />
<fieldset>
<div align="right">
<input type="button" value="Excluir" onClick="excluir();">
</div>
</fieldset>
<br />

<fieldset>

<div id="lista" style="overflow:auto; height:200px; width:100%; border: 0px; background: #FFF;" >
<br />
<form action="#" method="post" name="form2">

<table cellpadding="0" cellspacing="0" width="98%">
<tr class="barra_titulo_consultas">
<td width="3%" height="30"></td>
<td width="97%" valign="middle" align="left">
&nbsp;
<font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">
<b>Categorias vinculadas ao cadastro</b>
</font>
</td>
</tr>

<!-- START BLOCK : LOOP -->
<tr style="background-color:{cor};" onMouseOver="javascript:this.style.backgroundColor='#dce3e9'" onMouseOut="javascript:this.style.backgroundColor='{cor}'">
	<td valign="middle" height="30">
    <center>
    <input type="checkbox" id="ck{cont}" name="ck{cont}" value="{par_id}" />
    </center>
    </td>
	<td align="left">
    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">
    &nbsp; {nome}
    </font>
    </td>
</tr>
<!-- END BLOCK : LOOP -->

</table>
</form>
</div>
</fieldset>

</body>
</html>
